{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "initial_id",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-04-04T13:02:43.773268400Z",
     "start_time": "2025-04-04T13:02:43.698960700Z"
    }
   },
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "51b5af6debfb4d459a2ebce477e0b3c6",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Map(center=[0, 0], controls=(WidgetControl(options=['position', 'transparent_bg'], widget=SearchDataGUI(childr…"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import ee\n",
    "import geemap\n",
    "import os\n",
    "Map = geemap.Map()\n",
    "Map"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ae8e7c90-63a3-4ee5-901e-036ab8b5c48e",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-04-04T13:03:23.639460600Z",
     "start_time": "2025-04-04T13:02:47.350004100Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "            <style>\n",
       "                .geemap-dark {\n",
       "                    --jp-widgets-color: white;\n",
       "                    --jp-widgets-label-color: white;\n",
       "                    --jp-ui-font-color1: white;\n",
       "                    --jp-layout-color2: #454545;\n",
       "                    background-color: #383838;\n",
       "                }\n",
       "\n",
       "                .geemap-dark .jupyter-button {\n",
       "                    --jp-layout-color3: #383838;\n",
       "                }\n",
       "\n",
       "                .geemap-colab {\n",
       "                    background-color: var(--colab-primary-surface-color, white);\n",
       "                }\n",
       "\n",
       "                .geemap-colab .jupyter-button {\n",
       "                    --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
       "                }\n",
       "            </style>\n",
       "            "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "Sanjiang_Shp = geemap.shp_to_ee(\"../data/SanjiangPlainMerge/SanjiangPlainMerge.shp\")\n",
    "Map.addLayer(Sanjiang_Shp,{},\"SanjiangPlain\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "451d01833053c192",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-04-04T13:33:35.295115300Z",
     "start_time": "2025-04-04T13:33:27.216509500Z"
    },
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "            <style>\n",
       "                .geemap-dark {\n",
       "                    --jp-widgets-color: white;\n",
       "                    --jp-widgets-label-color: white;\n",
       "                    --jp-ui-font-color1: white;\n",
       "                    --jp-layout-color2: #454545;\n",
       "                    background-color: #383838;\n",
       "                }\n",
       "\n",
       "                .geemap-dark .jupyter-button {\n",
       "                    --jp-layout-color3: #383838;\n",
       "                }\n",
       "\n",
       "                .geemap-colab {\n",
       "                    background-color: var(--colab-primary-surface-color, white);\n",
       "                }\n",
       "\n",
       "                .geemap-colab .jupyter-button {\n",
       "                    --jp-layout-color3: var(--colab-primary-surface-color, white);\n",
       "                }\n",
       "            </style>\n",
       "            "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "image = ee.ImageCollection(\"COPERNICUS/S2_HARMONIZED\").filterDate('2022-04-15', '2022-05-15').filterBounds(Sanjiang_Shp).filter(ee.Filter.lt('CLOUDY_PIXEL_PERCENTAGE', 10)).mean()\n",
    "\n",
    "s2_vis = {\n",
    "    \"bands\":['B4','B3','B2'],\n",
    "    \"min\": 0,\n",
    "    \"max\": 4000,\n",
    "    \"gamma\":1.4,\n",
    "}\n",
    "\n",
    "Map.addLayer(image,s2_vis,\"S2_Sanjiang\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "636049475af77290",
   "metadata": {
    "collapsed": false,
    "jupyter": {
     "outputs_hidden": false
    }
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
